-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[7][15/n][enums/Move] Add flavor to serialized compiled module for versions >= 7 #17706
[7][15/n][enums/Move] Add flavor to serialized compiled module for versions >= 7 #17706
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
18e2936
to
72e8a84
Compare
a54c659
to
772709d
Compare
72e8a84
to
df4c290
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! it looks pretty good
df4c290
to
7d8b624
Compare
@@ -19,6 +19,54 @@ use std::{ | |||
mem::size_of, | |||
}; | |||
|
|||
// Static assertions about the encoding of the flavor into the version of the binary format. | |||
const _: () = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth naming this for easier debugging if the assertions ever fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not, but I'll add some more comments!
pub const FLAVOR_MASK: u32 = 0xFF00_0000; | ||
pub const VERSION_MASK: u32 = 0x00FF_FFFF; | ||
// The Sui flavor is 0x05 | ||
pub const SUI_FLAVOR: u8 = 0x05; | ||
const SHIFT_AMOUNT: u8 = 24; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there is a more-canonical way to do this in Rust, since we're doing it a few places now.
772709d
to
20f3837
Compare
7d8b624
to
5bd35d7
Compare
20f3837
to
37ecf65
Compare
5bd35d7
to
55e29f0
Compare
37ecf65
to
3be561d
Compare
55e29f0
to
8685a36
Compare
3be561d
to
6fd1819
Compare
8685a36
to
51696a1
Compare
6fd1819
to
cb31954
Compare
51696a1
to
8b3f82b
Compare
cb31954
to
dc7301f
Compare
8b3f82b
to
d8fbeb9
Compare
dc7301f
to
415134a
Compare
d8fbeb9
to
fc81aec
Compare
415134a
to
343f4c1
Compare
fc81aec
to
ffa7cab
Compare
## Description Turns on enums in move 2024 alpha, and updates the location of tests to reflect that. ## Test plan Update existing tests, and make sure they pass. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
Description
As discussed at the Move community meeting for versions of the Move binary format >= 7, we will start flavoring Sui serialized modules with the
0x05
flavor flag.Test plan
Added additional tests to make sure versions are properly serialized (both with and without flavors), and that they are properly deserialized, or an error is thrown if a version >= 7 is supplied without a correct flavor.
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.